<template lang="html">
    <div class="m-position">
      <div class="login" v-if="!isShowloading">
        <span>十秒钟定制职位</span>
        <span>
          <a>去登录</a>
        </span>
      </div>
      <div class="list" v-if="!isShowloading">
        <ul>
          <router-link :to="{name: 'detail', params: { id: list.positionId}}" tag="li" v-for="(list, i) in dataList" :key="i">
          <!-- <li @click="gotoDetail(list.positionId)" v-for="(list, i) in dataList"> -->
            <dl>
              <dt>
                <img :src="'//static.lagou.com/' + list.companyLogo" alt="">
              </dt>
              <dd>
                <p>{{list.companyName}}</p>
                <p>{{list.positionName}}</p>
                <p>{{list.createTime}}</p>
              </dd>
              <dd>
              </dd>
            </dl>
          <!-- </li> -->
          </router-link>
        </ul>
      </div>

      <div class="yo-loading yo-loading-a" v-if="isShowloading">
        <i class="yo-ico"></i>
        <div class="text">加载中...</div>
      </div>
    </div>
</template>

<script>
import '../../media/images/arrow.png'
import '../../media/images/ajax-loader.gif'

import axios from 'axios'
export default {
  data() {
    return {
      dataList: [],
      isShowloading: true
    }
  },
  methods: {
    gotoDetail(positionId) {
      this.$router.push({name: 'detail', params: { id: positionId}})
    }
  },
  mounted() {
    axios.get('/vip/list.php')
      .then((res)=>{
        const data = res.data.content.data.page.result
        this.dataList = data
        this.isShowloading = false
      })
  }
}
</script>
